package Cn.Sarkar.MMS.Entities.Independent

import Cn.Sarkar.Entities.Common.BaseEntityNoID
import Cn.Sarkar.Entities.Common.Independent.IApplicationDomain
import Cn.Sarkar.Entities.MMS.Independent.IAccount
import Cn.Sarkar.Entities.MMS.Independent.IApplication
import Cn.Sarkar.Entities.MMS.Independent.ICompany
import Cn.Sarkar.Entities.MMS.Independent.IDomainRelation
import Cn.Sarkar.Entities.MMS.Independent.Wallet.IWallet
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.DomainRelations
import Cn.Sarkar.MMS.Entities.Independent.Wallet.Wallet

class DomainRelation(DataContext: IDataContext) : BaseEntityNoID(DataContext, DomainRelations), IDomainRelation {
    var applicationID by DomainRelations.ApplicationID
    override var application: IApplication by hasOne(DomainRelations.ApplicationID) { Application(it) }
    var accountID by DomainRelations.AccountID
    override var account: IAccount by hasOne(DomainRelations.AccountID) { Account(it) }
    var applicationDomainID by DomainRelations.ApplicationDomainID
    override var applicationDomain: IApplicationDomain by hasOne(DomainRelations.ApplicationDomainID) { ApplicationDomain(it) }
    var walletID by DomainRelations.WalletID
    override var wallet: IWallet by hasOne(DomainRelations.WalletID) { Wallet(it) }
    var customerCompanyID by DomainRelations.CustomerCompanyID
    override var customerCompany: ICompany by hasOne(DomainRelations.CustomerCompanyID) { Company(it) }
}